﻿layui.define(['jquery', 'element', 'table'], function (exports) {
    "use strict";

    /**
     * 常用封装类
     * */
    var MOD_NAME = 'verify',
        $ = layui.jquery;
    var verify = new function () {
        /**
         * 验证用户名
         * @param {any} value
         */
        this.userName = function (value) {
            var flag = /(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,24}$/.test(value);
            if (flag) {
                return { isValid: true, msg: "验证通过" };
            } else {
                return { isValid: false, msg: "用户名只能由数字字母组成" };

            }
        }


    }
    exports(MOD_NAME, verify);
});
